From: Andres Lagar-Cavilla Date: Thu, 2 Feb 2012 12:22:34 +0000 (+0000) Subject: x86/mm: Don't fail to nominate for paging on type flag, rather look at type count X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=6623226237f1c2db19ed5b91b6dca4d1f8a6f8d7;p=xen.git x86/mm: Don't fail to nominate for paging on type flag, rather look at type count Xen doesn't clean the type flag when dropping the type count for a page to zero. So, looking at the type flag when nominating a page for paging it's incorrect. Look at the type count instead. Signed-off-by: Andres Lagar-Cavilla Signed-off-by: Adin Scannell Acked-by: Tim Deegan Committed-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 31a10d8a25..ded33853dc 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -759,7 +759,7 @@ int p2m_mem_paging_nominate(struct domain *d, unsigned long gfn) (1 | PGC_allocated) ) goto out; - if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_none ) + if ( (page->u.inuse.type_info & PGT_count_mask) != 0 ) goto out; /* Fix p2m entry */ @@ -820,7 +820,7 @@ int p2m_mem_paging_evict(struct domain *d, unsigned long gfn) (2 | PGC_allocated) ) goto out_put; - if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_none ) + if ( (page->u.inuse.type_info & PGT_count_mask) != 0 ) goto out_put; /* Decrement guest domain's ref count of the page */